import config from 'config';
import httpFetch from 'share/httpFetch';

export default {

  // 获取列表
  getLoanAmountMaxList(setOfBooksId,page){
    return httpFetch.get(`${config.baseUrl}/api/loanAmountMax/select?setOfBooksId=${setOfBooksId}&page=${page}&size=10`);
  },

  // 创建
  saveLoanRule(params){
    return httpFetch.post(`${config.baseUrl}/api/loanAmountMax/create`,params);
  },

  // 编辑
  updateLoanRule(params) {
    return httpFetch.put(`${config.baseUrl}/api/loanAmountMax/update`,params);
  },

  // 分配人员
  assignUsers(id, typeID, type, value) {
    return httpFetch.put(`${config.baseUrl}/api/loanAmountMax/update/users?loanAmountMaxId=${id}&loanTypeId=${typeID}&type=${type}`,value);
  },

  // 获取帐套下的借款类型
  getTypeList(setOfBooksId) {
    return httpFetch.get(`${config.baseUrl}/payment/api/cash/transaction/classes/queryBySetOfBookId/${setOfBooksId}?isNotPrePaymentCode=NONE`);
  }

}
